#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>

/*
 * 设置目前时间，只能精确到秒
 */

void main()
{
  struct tm tm;

  tm.tm_year = 2016;
  tm.tm_mon = 9;
  tm.tm_mday = 12;
  tm.tm_hour = 16;
  tm.tm_min = 32;
  tm.tm_sec = 30;

  time_t now = mktime(&tm);
  stime(&now);
}

